package cn.iocoder.yudao.module.bpm.api.amis;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.api.amis.dto.AmisListColumConfigDto;
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 基于amis处理数据")
public interface AmisFormDataApi {

    String PREFIX = ApiConstants.PREFIX + "/amis-data";

    @PostMapping(PREFIX + "/amisExportToExcel")
    @Operation(summary = "根据List数据、formKey导出exl")
    @Parameters({
        @Parameter(name = "amisFormCode", description = "表单Key", required = true) ,
        @Parameter(name = "type", description = "amis表单配置中列表组件的类型", required = true) ,
        @Parameter(name = "dataList", description = "列表数据", required = true)
    })
    CommonResult<byte[]> amisExportToExcel(
            @RequestParam("amisFormCode")  String amisFormCode,
            @RequestParam("type")  String type,
            @RequestBody List<Map> dataList
    );
}
